package com.framework.websocket.model;

/**
 * WebSocket 命令类型枚举
 */
public enum CommandType {
    
    /**
     * 心跳
     */
    HEARTBEAT("HEARTBEAT", "心跳"),
    
    /**
     * 订阅
     */
    SUBSCRIBE("SUBSCRIBE", "订阅"),
    
    /**
     * 取消订阅
     */
    UNSUBSCRIBE("UNSUBSCRIBE", "取消订阅"),
    
    /**
     * 清除所有订阅
     */
    CLEAR("CLEAR", "清除订阅"),
    
    /**
     * 列出所有可订阅类型
     */
    LIST("LIST", "列出订阅类型"),
    
    /**
     * 获取连接状态
     */
    STATUS("STATUS", "获取状态");
    
    private final String code;
    private final String desc;
    
    CommandType(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }
    
    public String getCode() {
        return code;
    }
    
    public String getDesc() {
        return desc;
    }
}